package io.starteos.wallet.utils.eos.data.remote.model.types;

import com.google.gson.annotations.Expose;

import io.starteos.wallet.utils.eos.crypto.util.HexUtils;
import io.starteos.wallet.utils.eos.data.remote.model.types.EosType.Writer;

public class EosEraseorder implements EosType.Packer{
	
	@Expose
	private TypeAccountName ord_name;
	
	@Expose
	private TypeCoins timestamp;
	
	public EosEraseorder(String ord_name, String timestamp) {
		this.ord_name = new TypeAccountName(ord_name);
		this.timestamp = new TypeCoins(timestamp);
	}
	
	public String getActionName() {
		return "eraseorder";
	}
	
	@Override
	public void pack(Writer writer) {
		ord_name.pack(writer);
		timestamp.pack(writer);
	}
	
	public String getAsHex() {
		EosType.Writer writer = new EosByteWriter(512);
		pack(writer);
		return HexUtils.toHex(writer.toBytes());
	}
}
